Video compression apparatus and video compression program

ABSTRACT

A video compression apparatus for compressing video data as a series of frames outputted from an imaging element that has a plurality of imaging regions for imaging a subject and for which imaging conditions can be set for the respective imaging regions, includes: a setting unit configured to set, based on an imaging condition set in a compression target region of a frame different from a reference frame, a search region for detecting a specific region in the reference frame; and a detection unit configured to detect, based on the compression target region, the specific region in the search region set by the setting unit.

CLAIM OF PRIORITY

This is a Continuation of application Ser. No. 16/651,884 filed Jun. 10,2020, which in turn is a National Stage of PCT/JP2018/036130 filed Sep.27, 2018, which claims priority from Japanese patent application JP2017-192105 filed on Sep. 29, 2017. The entire disclosure of each of theabove-identified applications is hereby incorporated by reference intothis application.

BACKGROUND

The present invention relates to a video compression apparatus and avideo compression program.

An electronic device has been suggested in which a backsideillumination-type imaging chip and a signal processing chip are layered(hereinafter referred to as a layered imaging element) (see JapaneseUnexamined Patent Application Publication No. 2006-49361). The layeredimaging element is configured so that the backside illumination-typeimaging chip and the signal processing chip are layered so that theformer and the latter are connected via a micro bump for eachpredetermined region. However, if the layered imaging element has aplurality of imaging conditions that can be set within an imagingregion, a frame imaged under the plurality of imaging conditions isoutputted. The video compression of such a frame has been conventionallynot considered.

SUMMARY

A video compression apparatus according to one aspect of the technologydisclosed in the present application is a video compression apparatusfor compressing video data as a series of frames outputted from animaging element that has a plurality of imaging regions for imaging asubject and for which imaging conditions can be set for the respectiveimaging regions, comprising: a setting unit configured to set, based onan imaging condition set in a compression target region of a framedifferent from a reference frame, a search region for detecting aspecific region in the reference frame; and a detection unit configuredto detect, based on the compression target region, the specific regionin the search region set by the setting unit.

A video compression apparatus according to another aspect of thetechnology disclosed in the present application is a video compressionapparatus for compressing video data as a series of frames outputtedfrom an imaging element that has a plurality of imaging regions forimaging a subject and for which imaging conditions can be set for therespective imaging regions, comprising: a setting unit configured to seta search region for detecting a specific region within a reference framebased on at least one of the plurality of imaging conditions set to theimaging element; and a detection unit configured to detect, based on acompression target region having a frame different from the referenceframe, the specific region from the search region set by the settingunit.

A video compression program according to one aspect of the technologydisclosed in the present application is a video compression program forcausing a processor to execute the compression of video data as a seriesof frames outputted from an imaging element that has a plurality ofimaging regions for imaging a subject and for which imaging conditionscan be set for the respective imaging regions, wherein the videocompression program causes the processor: to set, based on an imagingcondition set in a compression target region of a frame different from areference frame, a search region for detecting a specific region in thereference frame; and to detect, based on the compression target region,the specific region in the search region.

A video compression program according to another aspect of thetechnology disclosed in the present application is a video compressionprogram for causing a processor to execute the compression of video dataas a series of frames outputted from an imaging element that has aplurality of imaging regions for imaging a subject and for which imagingconditions can be set for the respective imaging regions, to set asearch region for detecting a specific region within a reference framebased on at least one of the plurality of imaging conditions set to theimaging element; and to detect, based on a compression target regionhaving a frame different from the reference frame, the specific regionfrom the search region set by the setting unit.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a cross-sectional view of a layered the imaging element.

FIG. 2 illustrates the pixel arrangement of the imaging chip.

FIG. 3 is a circuit diagram illustrating the imaging chip.

FIG. 4 is a block diagram illustrating an example of the functionalconfiguration of the imaging element.

FIG. 5 illustrates the block configuration example of an electronicdevice.

FIG. 6 illustrates a configuration example of a video file.

FIG. 7 illustrates the relation between an imaging face and a subjectimage.

FIG. 8 illustrates a specific configuration example of the video file600.

FIG. 9 illustrates a block matching example.

FIG. 10 is a block diagram illustrating a configuration example of thecontrol unit shown in FIG. 5.

FIG. 11 is a block diagram illustrating the configuration of thecompression unit.

FIG. 12 illustrates the examples of the search range, the search region,and the search window.

FIG. 13 illustrates the scanning example 1 at the boundary betweendifferent imaging conditions.

FIG. 14 illustrates the scanning example 2 at the boundary betweendifferent imaging conditions.

FIG. 15 illustrates the scanning example 3 at the boundary betweendifferent imaging conditions.

FIG. 16 illustrates the region magnification/reduction example of theimaging condition.

FIG. 17 illustrates the scanning example 4 at the boundary betweendifferent imaging conditions.

FIG. 18 illustrates the scanning example 5 at the boundary betweendifferent imaging conditions.

FIG. 19 illustrates the scanning example 6 at the boundary betweendifferent imaging conditions.

FIG. 20 is a flowchart illustrating the preprocessing procedure exampleby the preprocessing unit.

FIG. 21 is a flowchart illustrating the motion detection processingprocedure example 1 by the motion detection unit.

FIG. 22 is a flowchart illustrating the motion detection processingprocedure example 2 by the motion detection unit.

FIG. 23 illustrates the example of the block matching at different pixelaccuracies.

FIG. 24 is a flowchart illustrating an example of the motion vectordetection processing procedure by the motion detection unit at differentpixel accuracies.

DETAILED DESCRIPTION OF THE EMBODIMENT <Configuration Example of ImagingElement>

First, the following section will describe a layered imaging elementprovided in an electronic device. It is noted that this layered imagingelement is disclosed in Japanese Unexamined Patent ApplicationPublication No. 2012-139026 previously applied by the applicant of thisapplication. The electronic device is an imaging apparatus such as adigital camera or a digital video camera.

FIG. 1 is a cross-sectional view of a layered the imaging element 100.The layered imaging element (hereinafter simply referred to as “imagingelement”) 100 includes a backside illumination-type imaging chip tooutput a pixel signal corresponding to incident light (hereinaftersimply referred to as “imaging chip”) 113, a signal processing chip 111to process a pixel signal, and a memory chip 112 to store a pixelsignal. The imaging chip 113, the signal processing chip 111, and thememory chip 112 are layered and are electrically connected by a bump 109made of conductive material such as Cu.

As shown in FIG. 1, the incident light is inputted in a positivedirection in the Z axis mainly shown by the outlined arrow. In thisembodiment, the imaging chip 113 is configured so that a face to whichthe incident light is inputted is called a back face. As shown by thecoordinate axes, a left direction orthogonal to Z axis when viewed onthe paper is a positive X axis direction and a front directionorthogonal to the Z axis and the X axis when viewed on the paper is apositive Y axis direction. In some of the subsequent drawings, thecoordinate axes are shown so as to show the directions of the drawingsbased on the coordinate axes of FIG. 1 as a reference.

One example of the imaging chip 113 is a backside illumination-type MOS(Metal Oxide Semiconductor) image sensor. A PD (photo diode) layer 106is provided at the back face side of a wiring layer 108. The PD layer106 is provided in a two-dimensional manner and has a plurality of PDs104 in which the electric charge depending on the incident light isaccumulated and transistors 105 provided to correspond to the PDs 104.

The side at which the PD layer 106 receives the incident light has colorfilters 102 via a passivation film 103. The color filters 102 have aplurality of types to allow light to be transmitted through wavelengthregions different from one another. The color filters 102 have aspecific arrangement corresponding to the respective PDs 104. Thearrangement of the color filters 102 will be described later. Acombination of the color filter 102, the PD 104, and the transistor 105constitutes one pixel.

A side at which the color filter 102 receives the incident light has amicrolens 101 corresponding to each pixel. The microlens 101 collectsthe incident light toward the corresponding PD 104.

The wiring layer 108 has a wiring 107 to transmit a pixel signal fromthe PD layer 106 to the signal processing chip 111. The wiring 107 mayhave a multi-layer structure or may include a passive element and anactive element.

A surface of the wiring layer 108 has thereon a plurality of bumps 109.The plurality of bumps 109 are aligned with a plurality of bumps 109provided on an opposing face of the signal processing chip 111. Thepressurization of the imaging chip 113 and the signal processing chip111 for example causes the aligned bumps 109 to be bonded to have anelectrical connection therebetween.

Similarly, the signal processing chip 111 and the memory chip 112 havetherebetween faces opposed to each other that have thereon a pluralityof bumps 109. These bumps 109 are mutually aligned and thepressurization of the signal processing chip 111 and the memory chip 112for example causes the aligned bumps 109 to be bonded to have anelectrical connection therebetween.

The bonding between the bumps 109 is not limited to a Cu bump bonding bythe solid phase diffusion and may use a micro bump coupling by thesolder melting. One bump 109 may be provided relative to one block(which will be described later) for example. Thus, the bump 109 may havea size larger than the pitch of the PD 104. Surrounding regions otherthan a pixel region in which pixels are arranged may additionally have abump larger than the bump 109 corresponding to the pixel region.

The signal processing chip 111 has a TSV (silicon through-electrode) 110to provide the mutual connection among circuits provided on the top andback faces, respectively. The TSV 110 is preferably provided in thesurrounding region. The TSV 110 also may be provided in the surroundingregion of the imaging chip 113 and the memory chip 112.

FIG. 2 illustrates the pixel arrangement of the imaging chip 113. Inparticular, (a) and (b) of FIG. 2 illustrate the imaging chip 113observed from the back face side. In FIG. 2, (a) of FIG. 2 is a planview schematically illustrating an imaging face 200 that is a back faceof the imaging chip 113. In FIG. 2, (b) of FIG. 2 is an enlarged planview illustrating a partial region 200 a of the imaging face 200. Asshown in (b) of FIG. 2, the imaging face 200 has many pixels 201arranged in a two-dimensional manner.

The pixels 201 have color filter (not shown), respectively. The colorfilters consist of the three types of red (R), green (G), and blue (B).In (b) of FIG. 2, the reference numerals “R”, “G”, and “B” show thetypes of color filters owned by the pixels 201. As shown in (b) of FIG.2, the imaging element 100 has the imaging face 200 on which the pixels201 including the respective color filters as described above arearranged based on a so-called Bayer arrangement.

The pixel 201 having a red filter subjects red waveband light of theincident light to a photoelectric conversion to output a light receptionsignal (photoelectric conversion signal). Similarly, the pixel 201having a green filter subjects green waveband light of the incidentlight to a photoelectric conversion to output a light reception signal.The pixel 201 having a blue filter subjects blue waveband light of theincident light to a photoelectric conversion to output a light receptionsignal.

The imaging element 100 is configured so that a unit group 202consisting of the total of pixels 201 composed of 2 pixels×2 pixelsadjacent to one another can be individually controlled. For example,when two unit groups 202 different from each other simultaneously startthe electric charge accumulation, then one unit group 202 starts theelectric charge reading (i.e., the light reception signal reading) after1/30 seconds from the start of the electric charge accumulation and theanother unit group 202 starts the electric charge reading after 1/15seconds from the start of the electric charge accumulation. In otherwords, the imaging element 100 is configured so that one imagingoperation can have a different exposure time (or an electric chargeaccumulation time or a so-called shutter speed) for each unit group 202.

The imaging element 100 also can set, in addition to the above-describedexposure time, an imaging signal amplification factor (a so-called ISOsensibility) that is different for each unit group 202. The imagingelement 100 can have, for each unit group 202, a different timing atwhich the electric charge accumulation is started and/or a differenttiming at which the light reception signal is read. Specifically, theimaging element 100 can have a different video imaging frame rate foreach unit group 202.

In summary, the imaging element 100 is configured so that each unitgroup 202 has different imaging conditions such as the exposure time,the amplification factor, the frame rate, or the resolution. Forexample, a reading line (not shown) to read an imaging signal from aphotoelectric conversion unit (not shown) owned by the pixel 201 isprovided for each unit group 202 and an imaging signal can be readindependently for each unit group 202, thereby allowing each unit group202 to have a different exposure time (shutter speed).

An amplifier circuit (not shown) to amplify the imaging signal generatedby the electric charge subjected to the photoelectric conversion isindependently provided for each unit group 202. The amplification factorby the amplifier circuit can be controlled independently for eachamplifier circuit, thereby allowing each unit group 202 to have adifferent signal amplification factor (ISO sensibility).

The imaging conditions that can be different for each unit group 202 mayinclude, in addition to the above-described imaging conditions, theframe rate, a gain, a resolution (thinning rate), an addition linenumber or an addition row number to add pixel signals, the electriccharge accumulation time or the accumulation number, and a digitizationbit number for example. Furthermore, a control parameter may be aparameter in an image processing after an image signal is acquired froma pixel.

Regarding the imaging conditions, the brightness (diaphragm value) ofeach unit group 202 can be controlled by allowing the imaging element100 to include a liquid crystal panel having a zone that can beindependently controlled for each unit group 202 (one zone correspondsto one unit group 202) so that the liquid crystal panel is used as alight attenuation filter that can be turned ON or OFF for example.

The number of the pixels 201 constituting the unit group 202 is notlimited to the above-described 4 (or 2×2) pixels. The unit group 202 mayhave at least one pixel 201 or may include more-than-four pixels 201.

FIG. 3 is a circuit diagram illustrating the imaging chip 113. In FIG.3, a rectangle shown by the dotted line representatively shows a circuitcorresponding to one pixel 201. A rectangle shown by a dashed linecorresponds to one unit group 202 (202-1 to 202-4). At least a part ofeach transistor described below corresponds to the transistor 105 ofFIG. 1.

As described above, the pixel 201 has a reset transistor 303 that isturned ON or OFF by the unit group 202 as a unit. A transfer transistor302 of pixel 201 is also turned ON or OFF by the unit group 202 as aunit. In the example shown in FIG. 3, a reset wiring 300-1 is providedthat is used to turn ON or OFF the four reset transistors 303corresponding to the upper-left unit group 202-1. A TX wiring 307-1 isalso provided that is used to supply a transfer pulse to the fourtransfer transistors 302 corresponding to the unit group 202-1.

Similarly, a reset wiring 300-3 is provided that is used to turn ON ofOFF the four reset transistors 303 corresponding to the lower-left theunit group 202-3 so that the reset wiring 300-3 is provided separatelyfrom the reset wiring 300-1. A TX wiring 307-3 is provided that is usedto supply a transfer pulse to the four transfer transistors 302corresponding to the unit group 202-3 so that the TX wiring 307-3 isprovided separately from the TX wiring 307-1.

An upper-right unit group 202-2 and a lower-right unit group 202-4similarly have a reset wiring 300-2 and a TX wiring 307-2 as well as areset wiring 300-4 and a TX wiring 307-4 that are provided in therespective unit groups 202.

The 16 PDs 104 corresponding to each pixel 201 are connected to thecorresponding transfer transistors 302, respectively. The gate of eachtransfer transistor 302 receives a transfer pulse supplied via the TXwiring of each unit group 202. The drain of each transfer transistor 302is connected to the source of the corresponding reset transistor 303. Aso-called floating diffusion FD between the drain of the transfertransistor 302 and the source of the reset transistor 303 is connectedto the gate of the corresponding amplification transistor 304.

The drain of each reset transistor 303 is commonly connected to a Vddwiring 310 to which a supply voltage is supplied. The gate of each resettransistor 303 receives a reset pulse supplied via the reset wiring ofeach unit group 202.

The drain of each amplification transistor 304 is commonly connected tothe Vdd wiring 310 to which a supply voltage is supplied. The source ofeach amplification transistor 304 is connected to the drain of thecorresponding the selection transistor 305. The gate of each theselection transistor 305 is connected to a decoder wiring 308 to which aselection pulse is supplied. The decoder wirings 308 are providedindependently for 16 selection transistors 305, respectively.

The source of each selection transistor 305 is connected to a commonoutput wiring 309. A load current source 311 supplies a current to anoutput wiring 309. Specifically, the output wiring 309 to the selectiontransistor 305 is formed by a source follower. It is noted that the loadcurrent source 311 may be provided at the imaging chip 113 side or maybe provided at the signal processing chip 111 side.

The following section will describe the flow from the start of theaccumulation of the electric charge to the pixel output after thecompletion of the accumulation. A reset pulse is applied to the resettransistor 303 through the reset wiring of each unit group 202 and atransfer pulse is simultaneously applied the transfer transistor 302through the TX wiring of each unit group 202 (202-1 to 202-4). Then, thePD 104 and a potential of the floating diffusion FD are reset for eachunit group 202.

When the application of the transfer pulse is cancelled, each PD 104converts the received incident light to electric charge to accumulatethe electric charge. Thereafter, when a transfer pulse is applied againwhile no reset pulse is being applied, the accumulated electric chargeis transferred to the floating diffusion FD. The potential of thefloating diffusion FD is used as a signal potential after theaccumulation of the electric charge from the reset potential.

Then, when a selection pulse is applied to the selection transistor 305through the decoder wiring 308, a variation of the signal potential ofthe floating diffusion FD is transmitted to the output wiring 309 viathe amplification transistor 304 and the selection transistor 305. Thisallows the pixel signal corresponding to the reset potential and thesignal potential to be outputted from the unit pixel to the outputwiring 309.

As described above, the four pixels forming the unit group 202 havecommon reset wiring and TX wiring. Specifically, the reset pulse and thetransfer pulse are simultaneously applied to the four pixels within theunit group 202, respectively. Thus, all pixels 201 forming a certainunit group 202 start the electric charge accumulation at the same timingand complete the electric charge accumulation at the same timing.However, a pixel signal corresponding to the accumulated electric chargeis selectively outputted from the output wiring 309 by sequentiallyapplying the selection pulse to the respective selection transistors305.

In this manner, the timing at which the electric charge accumulation isstarted can be controlled for each unit group 202. In other words,images can be formed at different timings among different unit groups202.

FIG. 4 is a block diagram illustrating an example of the functionalconfiguration of the imaging element 100. An analog multiplexer 411sequentially selects the sixteen PDs 104 forming the unit group 202 tooutput the respective pixel signals to the output wiring 309 provided tocorrespond to the unit group 202. The multiplexer 411 is formed in theimaging chip 113 together with the PDs 104.

The pixel signal outputted via the multiplexer 411 is subjected to thecorrelated double sampling (CDS) and the analog/digital (A/D) conversionperformed by the signal processing circuit 412 formed in the signalprocessing chip 111. The A/D-converted pixel signal is sent to ademultiplexer 413 and is stored in a pixel memory 414 corresponding tothe respective pixels. The demultiplexer 413 and the pixel memory 414are formed in the memory chip 112.

A computation circuit 415 processes the pixel signal stored in the pixelmemory 414 to send the result to the subsequent image processing unit.The computation circuit 415 may be provided in the signal processingchip 111 or may be provided in the memory chip 112. It is noted thatFIG. 4 shows the connection of the four unit groups 202 but theyactually exist for each of the four unit groups 202 and operate in aparallel manner.

However, the computation circuit 415 does not have to exist for each ofthe four unit groups 202. For example, one computation circuit 415 mayprovide a sequential processing while sequentially referring to thevalues of the pixel memories 414 corresponding to the respective fourunit groups 202.

As described above, the output wirings 309 are provided to correspond tothe respective unit groups 202. The imaging element 100 is configured bylayering the imaging chip 113, the signal processing chip 111, and thememory chip 112. Thus, these output wirings 309 can use the electricalconnection among chips using the bump 109 to thereby providing a wiringarrangement without causing an increase of the respective chips in theface direction.

<Block Configuration Example of Electronic Device>

FIG. 5 illustrates the block configuration example of an electronicdevice. An electronic device 500 is a lens integrated-type camera forexample. The electronic device 500 includes an imaging optical system501, an imaging element 100, a control unit 502, a liquid crystalmonitor 503, a memory card 504, an operation unit 505, a DRAM 506, aflash memory 507, and a sound recording unit 508. The control unit 502includes a compression unit for compressing video data as describedlater. Thus, a configuration in the electronic device 500 that includesat least the control unit 502 functions as a video compressionapparatus.

The imaging optical system 501 is composed of a plurality of lenses andallows the imaging face 200 of the imaging element 100 to form a subjectimage. It is noted that FIG. 5 shows the imaging optical system 501 asone lens for convenience.

The imaging element 100 is an imaging element such as a CMOS(Complementary Metal Oxide Semiconductor) or a CCD (Charge CoupledDevice) and images a subject image formed by the imaging optical system501 to output an imaging signal. The control unit 502 is an electroniccircuit to control the respective units of the electronic device 500 andis composed of a processor and a surrounding circuit thereof.

The flash memory 507, which is a nonvolatile storage medium, includes apredetermined control program written therein in advance. The controlunit 502 reads the control program from the flash memory 507 to executethe control program to thereby control the respective units. Thiscontrol program uses, as a work area, the DRAM 506 functioning as avolatile storage medium.

The liquid crystal monitor 503 is a display apparatus using a liquidcrystal panel. The control unit 502 allows, at a predetermined cycle(e.g., 60/1 seconds), the imaging element 100 to form a subject imagerepeatedly. Then, the imaging signal outputted from the imaging element100 is subjected to various image processings to prepare a so-calledthrough image to display the through image on the liquid crystal monitor503. The liquid crystal monitor 503 displays, in addition to the abovethrough image, a screen used to set imaging conditions for example.

The control unit 502 prepares, based on the imaging signal outputtedfrom the imaging element 100, an image file (which will be describedlater) to record the image file on the memory card 504 functioning as aportable recording medium. The operation unit 505 has various operationunits such as a push button. The operation unit 505 outputs, dependingon the operation of these operation members, an operation signal to thecontrol unit 502.

The sound recording unit 508 is composed of a microphone for example andconverts the environmental sound to an acoustic signal to input theresultant signal to the control unit 502. It is noted that the controlunit 502 may record a video file not in the memory card 504 functioningas a portable recording medium but in a recording medium (not shown)included in the electronic device 500 such as a hard disk.

<Configuration Example of Video File>

FIG. 6 illustrates a configuration example of a video file. A video file600 is generated during the compression processing by a compression unit902 (which will be described later) within the control unit 502 and isstored in the memory card 504, the DRAM 506, or the flash memory 507.The video file 600 is composed of two blocks of a header section 601 anda data section 602. The header section 601 is a block positioned at thetop of the video file 600. The header section 601 includes therein afile basic information region 611, a mask region 612, and an imaginginformation region 613 stored in the above-described order.

The file basic information region 611 includes, for example, the recordsfor the size or offset of the respective units within the video file 600(e.g., the header section 601, the data section 602, the mask region612, the imaging information region 613). The mask region 612 includesthe records for imaging condition information and/or mask information(which will be described later) for example. The imaging informationregion 613 includes the record for imaging-related information such asthe model name of the electronic device 500 or information for theimaging optical system 501 (e.g., information related to an opticalcharacteristic such as aberration). The data section 602 is a blockpositioned at the rear side of the header section 601 and includes therecord for the image information or acoustic information for example.

<Relation Between the Imaging Face and the Subject Image>

FIG. 7 illustrates the relation between an imaging face and a subjectimage. In FIG. 7, (a) of FIG. 7 is a schematic view illustrating theimaging face 200 (imaging range) of the imaging element 100 and asubject image 701. In (a) of FIG. 7, the control unit 502 images thesubject image 701. The imaging operation of (a) of FIG. 7 also may beused as an imaging operation performed to prepare a live view image (aso-called through image).

The control unit 502 subjects the subject image 701 obtained by theimaging operation of (a) of FIG. 7 to a predetermined image analysisprocessing. The image analysis processing is a processing to use awell-known subject detection technique (a technique to compute a featurequantity to detect a range in which a predetermined subject exists) forexample to detect a main subject region and a background region. Theimage analysis processing causes the imaging face 200 to be divided to amain subject region 702 including a main subject and a background region703 including the background.

It is noted that (a) of FIG. 7 shows that a region approximatelyincluding the subject image 701 is shown as the main subject region 702.However, the main subject region 702 may have a shape formed along theexternal form of the subject image 701. Specifically, the main subjectregion 702 may be set so as not to include images other than the subjectimage 701.

The control unit 502 sets different imaging conditions for each unitgroup 202 in the main subject region 702 and each unit group 202 in thebackground region 703. For example, a precedent unit group 202 is set tohave a higher shutter speed than that of a subsequent unit group 202.This suppresses, in the imaging operation of (c) of FIG. 7 after theimaging operation of (a) of FIG. 7, the main subject region 702 fromhaving image blur.

The control unit 502 is configured, when the influence by a light sourcesuch as sun existing in the background region 703 causes the mainsubject region 702 to have a backlight status, to set the unit group 202of the former to have a relatively-high ISO sensibility or a lowershutter speed. The control unit 502 is also configured to set the unitgroup 202 of the latter to have a relatively-low ISO sensibility or ahigher shutter speed. This can prevent, in the imaging operation of FIG.7(c), the black defect of the main subject region 702 in the backlightstatus and the blown out highlights of the background region 703 havinga high light quantity.

It is noted that the image analysis processing may be a processingdifferent from the above-described processing to detect the main subjectregion 702 and the background region 703. For example, this processingmay be a processing to detect a part of the entire imaging face 200 thathas a brightness equal to or higher than a certain value (a part havingan excessively-high brightness) or that has a brightness lower than thethan a certain value (a part having an excessively-low brightness). Whenthe image analysis processing is such a processing, the control unit 502sets the shutter speed and/or the ISO sensibility so that the unit group202 included in the former region has an exposure value (Ev value) lowerthan that of the unit group 202 included in another region.

The control unit 502 sets the shutter speed and/or the ISO sensibilityso that the unit group 202 included in the latter region has an exposurevalue (Ev value) higher than that of the unit group 202 included inanother region. This can consequently allow an image obtained throughthe imaging operation of (c) of FIG. 7 to have a dynamic range widerthan the original dynamic range of the imaging element 100.

In FIG. 7, (b) of FIG. 7 shows one example of mask information 704corresponding to the imaging face 200 shown in (a) of FIG. 7. Theposition of the unit group 202 belonging to the main subject region 702stores therein “1” and the position of the unit group 202 belonging tothe background region 703 stores therein “2”, respectively.

The control unit 502 subjects the image data of the first frame to theimage analysis processing to detect the main subject region 702 and thebackground region 703. This allows, as shown in Fig. (c), the frameobtained by the imaging operation of (a) of FIG. 7 to be divided to themain subject region 702 and the background region 703. The control unit502 sets different imaging conditions for each unit group 202 in themain subject region 702 and each unit group 202 in the background region703 to perform the imaging operation of (c) of FIG. 7 to prepare imagedata. An example of the resultant mask information 704 is shown in (d)of FIG. 7.

The mask information 704 of (b) of FIG. 7 corresponding to the imagingresult of FIG. 7(a) and the mask information 704 of (d) of FIG. 7corresponding to the imaging result of (c) of FIG. 7 are obtained by theimaging operations performed at different times (or have a timedifference). Thus, these two pieces of the mask information 704 havedifferent contents when the subject has moved or the user has moved theelectronic device 500. In other words, the mask information 704 isdynamic information changing with the time passage. Thus, a certain unitgroup 202 has different imaging conditions set for the respectiveframes.

<Specific Example of the Video File>

FIG. 8 illustrates a specific configuration example of the video file600. The mask region 612 includes identification information 801,imaging condition information 802, and the mask information 704 recordedin above-described order.

The identification information 801 shows that this video file 600 isprepared by a multi imaging condition video imaging function. The multiimaging condition video imaging function is a function to use theimaging element 100 for which a plurality of imaging conditions is setto perform a video photographing operation.

The imaging condition information 802 is information showing whatapplication (objective, role) is owned by the unit group 202. Forexample, as described above, when the imaging face 200 ((a) of FIG. 7)is divided to the main subject region 702 and the background region 703,

the respective unit groups 202 belong to the main subject region 702 orthe background region 703.

Specifically, the imaging condition information 802 is information thatshows, in order to prepare this video file 600, that the unit group 202has two applications of “the main subject region is subjected to a videoimaging operation at 60 fps” and “the background region is subjected tothe video imaging operation at 30 fps” for example and that shows theunique numbers applied to these applications. For example, the number“1” is applied to the application that “the main subject region issubjected to a video imaging operation at 60 fps” and the number 2 isapplied to the application that “the background region is subjected tothe video imaging operation at 30 fps”, respectively.

The mask information 704 is information showing the applications(objectives, roles) of the respective unit groups 202. The maskinformation 704 is “information obtained by representing the numberapplied to the imaging condition information 802 as a two-dimensionalmap corresponding to the position of the unit group 202”. Specifically,when the unit group 202 arranged in a two-dimensional manner isidentified by the two-dimensional coordinate (x, y) based on twointegers (x, y), the application of the unit group 202 existing at theposition (x, y) is represented by the number existing at the position(x, y) of the mask information 704.

For example, when the number “1” exists at the coordinate (3,5) of themask information 704, it can be understood that the unit group 202positioned at the coordinate (3,5) has the application that “the mainsubject region is subjected to a video imaging operation at 60 fps”. Inother words, it can be understood that the unit group 202 positioned atthe coordinate (3,5) belongs to the main subject region 702.

It is noted that the mask information 704 is dynamic informationchanging for each frame. Thus, the mask information 704 is recorded foreach frame (i.e., for each data block Bi (which will be describedlater)) during the compression processing (not shown).

The data section 602 stores therein data blocks B1 to Bn as video datafor each frame F (F1 to Fn) in an order of the imaging operations. Thedata block Bi (I is an integer for which 1 n is established) includesthe mask information 704, image information 811, a Tv value map 812, anSv value map 813, a By value map 814, an Av value information 815,acoustic information 816, and additional information 817.

The image information 811 is information obtained by using the imagingoperation of (c) of FIG. 7 to record the imaging signal outputted fromthe imaging element 100 in a form prior to various image processings.The image information 811 is so-called RAW image data.

The Tv value map 812 is information obtained by representing the Tvvalue representing the shutter speed set for each unit group 202 so thatthe Tv value corresponds to the position of the unit group 202. Forexample, the shutter speed set for the unit group 202 positioned at thecoordinate (x, y) can be distinguished by investigating the Tv valuestored in the coordinate (x, y) of the Tv value map 812.

The Sv value map 813 is information obtained by representing the Svvalue representing the ISO sensibility set for each unit group 202 as atwo-dimensional map as in the Tv value map 812.

The By value map 814 is information obtained by representing the subjectluminance measured for each unit group 202 during the imaging operationof (c) of FIG. 7 (i.e., the By value representing the luminance of thesubject light entered each unit group 202) in the form of atwo-dimensional map as in the Tv value map 812.

The Av value information 815 is information representing the diaphragmvalue during the imaging operation of (c) of FIG. 7. The Av value is nota value existing for each unit group 202, unlike the Tv value, the Svvalue, and the By value. Thus, unlike the Tv value, the Sv value, andthe By value, only one Av value is stored and the Av value is notinformation obtained by mapping a plurality of values in atwo-dimensional manner.

In order to provide a smooth video reproduction, the acousticinformation 816 is divided for each information piece corresponding toone frame and is multiplexed with the data block Bi and the resultantdata is stored in the data section 602. It is noted that the acousticinformation 816 may be multiplexed not for one frame but for apredetermined number of frames. It is noted that the acousticinformation 816 is not always required to be included.

The additional information 817 is information obtained by representing,during the imaging operation of (c) of FIG. 7, the frame rate set foreach unit group 202 in the form of a two-dimensional map. How to set theadditional information 817 will be described later with reference toFIG. 14 and FIG. 15. It is noted that the additional information 817 maybe retained in the frame F but also may be retained in the cache memoryof the processor 1201 (which will be described later). When thecompression processing is executed real-time in particular, the use ofthe cache memory is preferred from the viewpoint of a high processing.

As described above, the control unit 502 is configured to record in thememory card 504, by performing the imaging operation based on the videoimaging function, the video file 600 in which the image information 811generated by the imaging element 100 for which imaging conditions can beset for each unit group 202 and data regarding the imaging conditionsfor each unit group 202 (e.g., the imaging condition information 802,the mask information 704, the Tv value map 812, the Sv value map 813,the By value map 814) are associated.

The following section will describe an illustrative embodiment of theabove-described video compression using the imaging element 100.

<Block Matching Example>

Next, the following section will describe the block matching in the casewhere a plurality of imaging conditions is set for one frame. In thisillustrative embodiment, when there is a difference in the imagingcondition in the search range used for the block matching, thisdifference is used to optimize the block matching, thereby providing thereduction of the processing load of the block matching and thesuppression of the decline of accuracy of the block matching.

FIG. 9 illustrates a block matching example. The electronic device 500has the above-described imaging element 100 and the control unit 502.The control unit 502 includes a preprocessing unit 900, an imageprocessing unit 901, and a compression unit 902. As described above, theimaging element 100 has a plurality of imaging regions to image asubject.

An imaging region is a collection of at least one or more pixels. Forexample, an imaging region is the above-described one or more unitgroups 202. The imaging region can set imaging conditions for each unitgroup 202. Specifically, an imaging condition includes the exposure time(shutter speed), the amplification factor (ISO sensibility), and theresolution as described above.

The imaging element 100 images a subject to output video data 910including a plurality of frames to the preprocessing unit 900 in thecontrol unit 502. An image region in the frame F is a region of imagedata imaged in a certain imaging region of the imaging element 100.

For example, when a certain imaging region is composed of one unit group202 (2×2 pixels), the corresponding image region also has the size ofthe unit group 202. Similarly, when a certain imaging region is composedof 2×2 unit groups 202 (4×4 pixels), the corresponding image region alsohas the size of the 2×2 unit groups 202.

In FIG. 9, it is assumed that a main subject of a subject photographedby the frame F (e.g., a focused subject) is imaged based on the imagingcondition A and the background region is imaged based on the imagingcondition B. The imaging conditions A and B are imaging conditions thatare the same type and that have different values. For example, assumingthat the imaging conditions A and B are the exposure time, then theimaging condition A is 1/500 [seconds] and the imaging condition B is1/60 [seconds], for example. If the imaging condition is the exposuretime, the imaging condition is stored in the Tv value map 812 of thevideo file 600 shown in FIG. 8.

Similarly, when the imaging condition is the ISO sensibility, theimaging condition is stored in the Sv value map 813 of the video file600 shown in FIG. 8. When the imaging condition is a frame rate, theimaging condition is stored in the additional information 817 of thevideo file 600 shown in FIG. 8.

The preprocessing unit 900 executes, with regard to the video data 910,the preprocessing of the image processing by the image processing unit901. Specifically, when the preprocessing unit 900 receives the videodata 910 from the imaging element 100 (in this case a collection of RAWimage data), the preprocessing unit 900 uses the well-known subjectdetection technique to detect a specific subject such as a main subject,for example. The preprocessing unit 900 also predicts the imaging regionof the specific subject to set the imaging condition of the imagingregion in the imaging element 100 to a specific imaging condition.

For example, when the imaging condition B is set for the entire imagingface 200 and the specific subject such as the main subject is detectedand imaged, the preprocessing unit 900 outputs the imaging condition Ato the imaging element 100 so that the imaging region of the imagingelement 100 in which the specific subject is imaged has the imagingcondition A. This allows the imaging region of the specific subject tobe set to the imaging condition A and to set imaging regions other thanthis imaging region to be set to the imaging condition B.

Specifically, the preprocessing unit 900 may detect the motion vector ofthe specific subject based on a difference between an imaging region inwhich the specific subject in the input frame is detected and an imagingregion in which the specific subject of the inputted frame is detectedto identify the imaging region of the specific subject in the next inputframe. In this case, the preprocessing unit 900 outputs, to the imagingelement 100, an instruction to change, with regard to the identifiedimaging region, the image condition to the imaging condition A. Thisallows the imaging region of the specific subject to be set to theimaging condition A and imaging regions other than the imaging region tobe set to the imaging condition B.

The image processing unit 901 subjects the video data 910 inputted fromthe imaging element 100 to an image processing (e.g., a demosaicprocessing, a white balance adjustment, noise reduction, debayer). Thecompression unit 902 compresses the video data 910 inputted from theimage processing unit 901. The compression unit 902 performs thiscompression by a hybrid encoding operation obtained by combining themotion compensation inter-frame prediction (Motion Compensation: MC) andthe discrete cosine conversion (Discrete Cosine Transform: DCT) with theentropy coding.

In the motion detection, the compression unit 902 performs the blockmatching. The block matching is one example of a processing to detect aspecific region. The block matching is a technique according to which ablock having the frame F1 as a compression target is used as the targetblock b1 as a compression target region and the frame F2 inputtedtemporally previous to (or after) the frame F1 is used as a referenceframe to detect the block b2 from the search range SR of the frame F2that has the highest correlation degree with the target block b1. Then,a difference between the coordinate position of the block b2 detected bythe block matching and the coordinate position of the target block b1 isused as the motion vector my. The evaluation value of the correlationdegree is generally a square error or an absolute value error.

The compression unit 902 is configured, when the target block b1 isimage data imaged in the frame F1 based on the imaging condition A, touse the same position as that of the target block b1 in the frame F2 asa search window w. The shape of the search window w is not limited to arectangle shape and may be any polygonal shape. The search range SR is apredetermined range having the search window w at the center thereof.The range of the search range SR may be defined as a compressionreference. The compression unit 902 sets, in the frame F2, an overlappedregion of the ranges of the search range SR and the imaging condition Aas a search region SA to scan the search window w (represented by thearrow) in the search region SA to detect the block b2 having the highestcorrelation with the target block b1 to generate the motion vector my.It is noted that the scanning is not limited to one pixel unit and alsomay be performed on an any unit such as a half pixel unit or a quarterpixel unit.

The main subject is imaged based on the imaging condition A. The targetblock b1 is a part of the main subject. The block b2 having the highestcorrelation with the target block b1 exists only in the imagingcondition A. Thus, the only necessary operation is to search the searchregion SA that is the overlapped region of the ranges of the searchrange SR and the imaging condition A. As described above, since thesearch range SR may be narrowed down to the search region SA in advance,the search processing in the block matching can have a higher speed.Furthermore, the search range SR can be narrowed down to the searchregion SA that has the same imaging condition as the imaging conditionof the target block b1, thus the decline of the block matching accuracycan be suppressed.

It is noted that the control unit 502 may execute the compressionprocessing of the video data 910 from the imaging element 100 as areal-time processing or as a batch processing. For example, the controlunit 502 may store the video data 910 from the imaging element 100, thepreprocessing unit 900, or the image processing unit 901 once in thememory card 504, the DRAM 506, or the flash memory 507 to read, whenthere is a trigger issued automatically or issued by a user operation,the video data 910 to subject the resultant data to the compressionprocessing by the compression unit 902.

<Configuration Example of the Control Unit 502>

FIG. 10 is a block diagram illustrating a configuration example of thecontrol unit 502 shown in FIG. 5. The control unit 502 has apreprocessing unit 900, the image processing unit 901, an acquisitionunit 1020, and the compression unit 902. The control unit 502 iscomposed of a processor 1001, a memory 1002, an integrated circuit 1003,and a bus 1004 providing the connection thereamong.

The preprocessing unit 900, the image processing unit 901, theacquisition unit 1020, and the compression unit 902 may be realized byallowing a program stored in the memory 1002 to be executed by theprocessor 1001 or may be realized by the integrated circuit 1003 (e.g.,ASIC (Application Specific Integrated Circuit) or FPGA(Field-Programmable Gate Array)). The processor 1001 may use the memory1002 as a work area. The integrated circuit 1003 may use the memory 1002as a buffer to temporarily retain various pieces of data including imagedata.

The preprocessing unit 900 subjects the video data 910 from the imagingelement 100 to the preprocessing of the image processing by the imageprocessing unit 901. Specifically, the preprocessing unit 900 has adetection unit 1011 and a setting unit 1012 for example. The detectionunit 1011 detects a specific subject by the above-described well-knownsubject detection technique.

The setting unit 1012 applies the additional information 817 to therespective frames constituting the video data 910 from the imagingelement 100. The setting unit 1012 changes the frame rate of an imagingregion of the imaging face 200 of the imaging element 100 in which aspecific subject is detected.

Specifically, the setting unit 1012 detects the motion vector of thespecific subject from a difference between the imaging region in which aspecific subject is detected in the input frame and an imaging region inwhich the specific subject of an inputted frame is detected for exampleto predict the imaging region of the specific subject at the next inputframe. The setting unit 1012 outputs, to the imaging element 100, aninstruction to change the specific imaging condition (e.g., the imagingcondition A) for the predicted imaging region to the second frame rate.

The image processing unit 901 executes the image processing on therespective frames of the video data 910 outputted from the preprocessingunit 900. Specifically, the image processing unit 901 executes a knownimage processing such as a demosaic processing or white balanceadjustment as described above, for example.

The acquisition unit 1020 retains the video data 910 outputted from theimage processing unit 901 in the memory 1002 and outputs, at apredetermined timing, a plurality of frames included in the video data910 one by one to the compression unit 90 in the order of time scales.Specifically, the compression unit 902 sets the overlapped region in theframe F2 of the ranges of the search range SR and the imaging conditionA to the search region SA and scans the search window w in the searchregion SA (represented by the arrow) to detect the block b2 as describedabove, for example.

<Configuration Example of the Compression Unit 902>

FIG. 11 is a block diagram illustrating the configuration of thecompression unit 902. As described above, the compression unit 902compresses the respective frames of the video data 910 by the hybridcoding obtained by combining the motion compensation inter-framepredicted (MC) and the discrete cosine conversion (DCT) with the entropycoding.

The compression unit 902 includes a subtraction unit 1101, a DCT unit1102, a quantization unit 1103, an entropy coding unit 1104, a codeamount control unit 1105, an inverse quantization unit 1106, an inverseDCT unit 1107, a generation unit 1108, a frame memory 1109, a motiondetection unit 1110, a motion compensation unit 1111, and a compressioncontrol unit 1312. The subtraction unit 1101 to the motion compensationunit 1111 have a configuration similar to that of the conventionalcompression unit.

Specifically, the subtraction unit 1101 subtracts, from an input frame,a prediction frame from the motion compensation unit 1111 that predictsthe input frame to output difference data. The DCT unit 1102 subjectsthe difference data from the subtraction unit 1101 to the discretecosine conversion.

The quantization unit 1103 quantizes the difference data subjected tothe discrete cosine conversion. The entropy coding unit 1104 executesthe entropy coding on the quantized difference data and also executesthe entropy coding on the motion vector from the motion detection unit1110.

The code amount control unit 1105 controls the quantization by thequantization unit 1103. The inverse quantization unit 1106 executes theinverse quantization on the difference data quantized by thequantization unit 1103 to obtain the difference data subjected to thediscrete cosine conversion. The inverse DCT unit 1107 executes aninverse discrete cosine conversion on the difference data subjected tothe inverse quantization.

The generation unit 1108 adds the difference data subjected to theinverse discrete cosine conversion to the prediction frame from themotion compensation unit 1111 to generate a reference frame that isreferred to by a frame inputted temporally later than the input frame.The frame memory 1109 retains the reference frame obtained from thegeneration unit 1108.

The motion detection unit 1110 uses the input frame and the referenceframe to detect a motion vector. The motion detection unit 1110 has aregion setting unit 1121 and a motion generation unit 1122. In order toexecute the motion detection, the region setting unit 1121 sets a searchregion for the block matching.

As described above, the block matching is a technique to set a blockhaving the frame F1 as a compression target as a target block b1 anddetects a block b2 that has the highest correlation degree with thetarget block b1 from among the search range SR of the frame F2 inputtedtemporally previous to (or after) the frame F1 to detect, as a motionvector my, a difference between the coordinate position of the block b2and the coordinate position of the target block b1 (see FIG. 9). Theevaluation value of the correlation degree is generally a square erroror an absolute value error.

The region setting unit 1121 is configured, when the target block b1 isimage data imaged in the frame F1 based on the imaging condition A, toset, as a search window w, the same position as that of the target blockb1 in the frame F2. The search range SR is a range having the searchwindow w at the center thereof. The region setting unit 1121 sets, asthe search region SA, the overlapped region in the frame F2 of theranges of the search range SR and the imaging condition A.

The motion generation unit 1122 generates the motion vector my based onthe target block b1 and the block b2. Specifically, the motiongeneration unit 1122 scans the search window w in the search region SAset by the region setting unit 1121 (represented by the arrow) to detectthe block b2 having the highest correlation degree with the target blockb1, for example. The motion generation unit 1122 generates, as themotion vector my, a difference between the coordinate position of theblock b2 and the coordinate position of the target block b1.

As described above, the search range SR can be narrowed down to thesearch region SA in advance, thus the search processing of the blockmatching having a higher speed can be provided. Furthermore, the searchrange SR can be narrowed down to the search region SA having the sameimaging condition as the imaging condition of the target block b1, thusthe decline of the block matching accuracy can be suppressed.

The motion compensation unit 1111 uses the reference frame and themotion vector to generate the prediction frame.

Specifically, the motion compensation unit 1311 uses a specificreference frame among a plurality of reference frames retrained by theframe memory 1109 and a motion vector my for example to execute themotion compensation. The use of the reference frame as a specificreference frame can suppress the high-load motion compensation thatrequires reference frames other than the specific reference frame.Furthermore, the specific reference frame set as one reference frameobtained from the temporally-previous frame of the input frame can avoidthe high-load motion compensation and can reduce the motion compensationprocessing load.

<Scanning Example of the Search Window>

Next, the following section will describe the scanning example of thesearch window w with reference to FIG. 12 to FIG. 19. The descriptionwill be made using the frame F2 shown in FIG. 9.

FIG. 12 illustrates the examples of the search range, the search region,and the search window. The illustration in FIG. 12 pays attention on apart of the frame F2 (specifically, the boundary between the imagingconditions A and B). An image region 1200 is a region in the frame F2corresponding to an imaging region of the frame F2 and corresponds to4×4 pixels (i.e., 2×2 unit groups 202), for example. In FIG. 12, theframe F2 is composed of 4×5 image regions 1200.

It is noted that, in FIG. 12, the imaging conditions are set based on animaging region unit corresponding to the image region 1200 (i.e., 2×2unit groups 202) as one example. However, the imaging conditions alsomay be set based on an imaging unit composed of one unit group 202 orunits larger than 2×2 unit groups 202. It is noted that the searchwindow w has a size of 3×3 pixels.

The motion generation unit 1122 may scan the search window w in thesearch region SA so that the search window w at the boundary of theimaging conditions A and B does not include any single pixel of a regionof the imaging condition B or may scan both regions of the imagingconditions A and B or may scan a region of the imaging condition B onlythat is away from the imaging condition A by predetermined pixels. Thefollowing section will describe this in this order. It is noted that, inFIG. 13 to FIG. 19, the legend of FIG. 12 is used.

In FIG. 13 to FIG. 19, the description will be made while payingattention on 4×4 image regions 1200 including the boundary of theimaging conditions A and B (the upper-left image region 1200 is assumedas an image region 1201, the upper-right image region 1200 is assumed asan image region 1202, the lower-left image region 1200 is assumed as animage region 1203, and the lower-right image region 1200 is assumed asan image region 1204). The search window w is scanned in the rightdirection from the upper left of the frame F2 (white thick arrow) toreach the right end. When the search window w reaches the right end, thesearch window w is shifted by one pixel and is scanned from the left endto the right end (raster scan). However, a so-called diamond scanningperformed from the center in a radial manner may be used.

It is noted that the scanning width from the left end to the right endof the search window w may be within the number of pixels in thedirection along which the search window w is scanned (3 pixels in thisexample). Similarly, the shift width of the search window w in the lowerdirection is not limited to one pixel and may be within the number ofpixels of the width of the direction along which the search window w isshifted (3 pixels in this example).

FIG. 13 illustrates the scanning example 1 at the boundary betweendifferent imaging conditions. In FIG. 13, (a)-(e) of FIG. 13 are shownin the order of time scales. In the scanning example 1, the motiongeneration unit 1122 scans the search window w so as to include regionsof the imaging condition A only. Thus, in (a)-(e) of FIG. 13, the searchwindow w does not include regions of the imaging condition B.

FIG. 14 illustrates the scanning example 2 at the boundary betweendifferent imaging conditions. In FIG. 14, (a)-(e) of FIG. 14 are shownin the order of time scales. In the scanning example 2, the motiongeneration unit 1122 scans the search window w at the boundary of theimaging conditions A and B so that the region of the imaging condition Ais always larger than the region of the imaging condition B. The 9pixels of the search window w include the region of the imagingcondition A that is composed of 6 pixels in (a) of FIG. 14 and that iscomposed of 6 pixels in (b) of FIG. 14 and that is composed of 5 pixelsin (c) of FIG. 14 and that is composed of 6 pixels in (d) of FIG. 14. Inthe scanning after FIG. 14(d), the same scanning operations as those of(d) of FIG. 13 and (e) of FIG. 13 are performed.

FIG. 15 illustrates the scanning example 3 at the boundary betweendifferent imaging conditions. In FIG. 15, (a)-(d) of FIG. 15 are shownin the order of time scales. In the scanning example 2, the motiongeneration unit 1122 scans the search window w at the boundary of theimaging conditions A and B so that the region of the imaging condition Bis larger than the region of the imaging condition A as much aspossible. The 9 pixels of the search window w include the region of theimaging condition B that is composed of 6 pixels in (a) of FIG. 15 andthat is composed of 6 pixels in (b) of FIG. 15 and that is composed of 6pixels in (c) of FIG. 15. In the scanning position of (d) of FIG. 15 oneline down from (c) of FIG. 15, the region of the imaging condition B iscomposed of 3 pixels at the lower end of the image region 1201. In thescanning after (d) of FIG. 15, the same scanning operations as those of(d) and (e) of FIG. 13 are performed.

FIG. 16 illustrates the region magnification/reduction example of theimaging condition. In FIG. 16, (a) of FIG. 16 illustrates themagnification example and (b) of FIG. 16 illustrates the reductionexample. When image regions having different imaging conditions areadjacent to each other, the video compression apparatusmagnifies/reduces the search region SA from the viewpoint of reducingthe processing load of the block matching or suppressing the decline ofthe block matching accuracy.

For example, it is assumed that image regions adjacent to each otherhave imaging conditions A and B. It is assumed that the imagingcondition A has an image region of a specific subject while the imagingcondition B has an image region of a background. It is assumed that animaging condition is an exposure time (shutter speed).

For example, if the imaging condition A has the exposure time of 1/30[seconds] and the imaging condition B has the exposure time of 1/60[seconds], then there is a small difference between the exposure times.Thus, there may be a possibility where the main subject exists in theimage region of the imaging condition B. Thus, if the difference betweenthe imaging conditions A and B is equal to or a lower than thresholdvalue T1, the region setting unit 1121 magnifies the search region SA ofthe imaging condition A. This can consequently suppress the decline ofthe block matching accuracy.

When the imaging condition A has the exposure time of 1/30 [seconds]while the imaging condition B has the exposure time of 1/1000 [seconds]for example, there is a large difference between the exposure times.Thus, there may be a possibility where the main subject does not existin the image region of the imaging condition B. Thus, if the differencebetween the imaging conditions A and B exceeds a threshold value T2(T2≥T1), the region setting unit 1121 reduces the search region SA ofthe imaging condition A. This can consequently reduce the processingload of the block matching.

When the subject includes a dark space and a bright space and the darkspace includes therein the main subject, the dark space must have anexposure time longer than that of the bright space. Thus, the regionsetting unit 1121 sets the dark space to have the exposure time of theimaging condition A and sets the bright space to have the exposure timeof the imaging condition B (the imaging condition A is long time-secondthan the imaging condition B). Then, the region setting unit 1121reduces the search region SA of the imaging condition A. This canconsequently reduce the processing load of the block matching.

It is noted that, although the case was described in which the imagingcondition was the exposure time, the invention also may be applied tothe case where the imaging condition is the ISO sensibility or theresolution. The following section will specifically describe an examplein which the region of the imaging condition is magnified or reduced.

In (a) of FIG. 16, the region setting unit 1121 magnifies the outer edge1600 of the region of the imaging condition A to the outer side (i.e.,magnifies the outer edge 1600 of the region of the imaging condition Ato the region side of the imaging condition B) to provide an outer edge1601. However, the imaging condition B between the outer edge 1600 andthe outer edge 1601 is left unchanged. The search region SA1 after themagnification becomes a region in the search range SR that is providedin the region of the imaging condition A and the region between theouter edge 1601 and the outer edge 1600. This allows the search regionSA to be magnified to the search region SA1. Thus, the outer side of thesearch region SA also can be set as a block matching target, thusproviding a higher block matching accuracy than in the case where thesearch region SA is searched.

In (b) of FIG. 16, the region setting unit 1121 reduces the outer edge1600 of the region of the imaging condition A to the inner side (i.e.,reduces the outer edge 1600 of the region of the imaging condition A tothe region side of the imaging condition A) to provide an outer edge1602. However, the imaging condition A between the outer edge 1600 andthe outer edge 1602 is left unchanged. The search region SA2 after thereduction becomes a region obtained by subtracting, from the searchregion SA, a region between the outer edge 1600 and the outer edge 1602.This allows the search region SA to be reduced to the search region SA2.Thus, the region of the imaging condition A at the outer side of thesearch region SA2 can be excluded from the block matching target, thusproviding a block matching processing that has a higher speed than inthe case where the search region SA is searched.

It is noted that the region setting unit 1121 in FIG. 16 sets the searchregion SA to subsequently magnify the search region SA. However, anotherconfiguration may be used in which, when the search region SA is set,the search region SA1 may be set to include the image region of theimaging condition B surrounding the image region of the imagingcondition A.

FIG. 17 illustrates the scanning example 4 at the boundary betweendifferent imaging conditions. In FIG. 17, (a)-(d) of FIG. 17 are shownin the order of time scales. In the scanning example 4, the motiongeneration unit 1122 is the scanning example of the search window w inthe search region SA1 shown in (a) of FIG. 16. In the scanning example4, the motion generation unit 1122 scans the search window w so that thesearch window w is abutted to the boundary of the imaging conditions Aand B as much as possible and includes the region of the imagingcondition B. In the scanning position of (c) of FIG. 17 one line downfrom (b) of FIG. 17, the search window w includes the region of theimaging condition A. Similarly, in the scanning position of (d) of FIG.17 one line down from (c) of FIG. 17, the search window w includes theregion of the imaging condition A.

FIG. 18 illustrates the scanning example 5 at the boundary betweendifferent imaging conditions. In FIG. 18, (a)-(d) of FIG. 18 are shownin the order of time scales. In the scanning example 5, the motiongeneration unit 1122 is the scanning example of the search window w inthe search region SA1 shown in (a) of FIG. 16. In the scanning example5, the motion generation unit 1122 scans the search window w so that thesearch window w does not abutted to the boundary of the imagingconditions A and B and includes the region of the imaging condition B.

In (a) of FIG. 18, the search window w is at a position one pixel awayfrom the imaging condition A in the left and upper directions. In (b) ofFIG. 18, the search window w is at a position one pixel away from theimaging condition A in the left direction. At the scanning position of(c) of FIG. 18 one line down from (b) of FIG. 18, the search window wincludes the region of the imaging condition A. Similarly, at thescanning position of (d) of FIG. 18 one line down from (c) of FIG. 18,the search window w includes the region of the imaging condition A.

In FIG. 19, (a)-(d) in FIG. 19 illustrate the scanning example 6 at theboundary between different imaging conditions. (a)-(d) in FIG. 19 areshown in the order of time scales. In the scanning example 6, the motiongeneration unit 1122 is the scanning example of the search window w inthe search region SA2 shown in (b) of FIG. 16. In the scanning example6, the motion generation unit 1122 scans the search window w so that thesearch window w does not always include the region of the imagingcondition B.

In this manner, at the boundary between the image regions of thedifferent imaging conditions A and B, the reduction of the processingload and the suppression of the decline of the accuracy can be adjustedfor the block matching. In particular, the motion generation unit 1122can execute the block matching so that the search window w includespixels of the imaging condition A only to thereby pay a particularattention on the reduction of the processing load of the block matchingat the boundary of the image regions of the different imagingconditions.

Furthermore, the motion generation unit 1122 can execute the blockmatching so that the number of pixels of the imaging condition A in thesearch window w is higher than the number of pixels of the imagingcondition B to thereby achieve, in the block matching at the boundary ofthe image regions of the different imaging conditions, the suppressionof the decline of the accuracy while prioritizing the reduction of theprocessing load.

Furthermore, the motion generation unit 1122 can execute the blockmatching so that the search window w includes therein at least one pixelof the imaging condition A to thereby achieve, in the block matching atthe boundary of the image regions of the different imaging conditions,the suppression of the decline of the accuracy while maintaining thereduction of the processing load.

<Preprocessing Procedure Example>

FIG. 20 is a flowchart illustrating the preprocessing procedure exampleby the preprocessing unit 900. In FIG. 20, the imaging element 100 hasthe imaging condition B in advance. The subject detection technique ofthe detection unit 1011 is used to track the image region having theimaging condition A to feedback the result to the imaging element 100.It is noted that the image regions of the imaging condition A and B maybe always fixed.

The preprocessing unit 900 waits for the input of the framesconstituting the first video data 910 (Step S2001: No). Upon receivingthe input of the frames (Step S2001: Yes), the preprocessing unit 900judges whether or not a specific subject such as a main subject isdetected by the detection unit 1011 (Step S2002). When no specificsubject is detected (Step S2002: No), the processing proceeds to StepS2001.

When a specific subject is detected (Step S2002: Yes) on the other hand,the preprocessing unit 900 uses the detection unit 1011 to compare thetemporally-previous previous frame (e.g., a reference frame) with theinput frame to detect a motion vector to predict the image region of theimaging condition A for the next input frame to output the predictedimage region to the imaging element 100 to proceed to Step S2001 (StepS2003). This allows the imaging element 100 sets the imaging conditionsfor the unit group 202 constituting the imaging region corresponding tothe predicted image region to the imaging condition A and sets theimaging conditions for the remaining unit group 202 to the imagingcondition B to image the subject.

Then, the processing returns to Step S2001. When no frame is inputted(Step S2001: No) and the input of all frames constituting the video data910 is completed, a series of processings are completed.

<Motion Vector Detection Processing Procedure>

Next, the following section will describe a detection processingprocedure example of the motion vector my by a motion detection unit1110. The flowchart described below shows the detection processingprocedure example of the motion vector my of the imaging condition Aunder which a specific subject image may exist.

FIG. 21 is a flowchart illustrating the motion detection processingprocedure example 1 by the motion detection unit 1110. First, the motiondetection unit 1110 acquires an input frame as a compression target anda reference frame in a frame memory (Step S2101). The motion detectionunit 1110 sets the search range SR of the imaging condition A for thereference frame (Step S2102). Specifically, the motion detection unit1110 sets the target block b1 in the input frame from the image regionof the imaging condition A and sets, in the reference frame, the searchwindow w at the same position as that of the target block b1, forexample. Then, the motion detection unit 1110 sets the search range SRhaving the search window w at the center thereof as the reference frame(see FIG. 12).

Next, the motion detection unit 1110 identifies the search region SAthat is within the search range SR and that is the image region of theimaging condition A (Step S2103). Then, the motion detection unit 1110allows the motion generation unit 1122 to scan the search window w inthe identified search region SA to thereby execute the block matching onthe target block b1 (Step S2104) to generate the motion vector my fromthe block b2 to the target block b1 (Step S2105).

Through the block matching, the motion detection unit 1110 detects, fromthe reference frame, the block b2 having the highest correlation degreewith the target block b1 to generate, as the motion vector my, adifference between the coordinate position of the block b2 and thecoordinate position of the target block b1, for example. The evaluationvalue of the correlation degree may be a square error or an absolutevalue error, for example. Thereafter, a series of processings arecompleted.

As described above, the search range SR can be narrowed down to thesearch region SA in advance, thus a higher speed in the searchprocessing of the block matching can be provided. Furthermore, thesearch range SR can be narrowed down to the search region SA having thesame imaging condition as the imaging condition of the target block b1,thus the decline of the block matching accuracy can be suppressed.

FIG. 22 is a flowchart illustrating the motion detection processingprocedure example 2 by the motion detection unit 1110. In the motiondetection processing procedure example 2 of FIG. 22, the processingexample will be described that is used to magnify/reduce the searchregion SA of the imaging condition. It is noted that the imagingconditions A and B may be set by allowing a user to operate theoperation unit 505 or may be automatically set by the electronic device500 depending on the light reception amounts of the respective unitgroups 202 of the imaging element 100. The same processings as those ofFIG. 21 are given with the same step number and will not be describedfurther.

After Step S2103, the motion detection unit 1110 allows the regionsetting unit 1121 to identify the image region of the imaging conditionB that is within the search range SR and that is adjacent to the imagingcondition A (Step S2204). Then, the motion detection unit 1110 allowsthe region setting unit 1121 to magnify or reduce the search region SAidentified in Step S2103 based on the image region of the imagingcondition A and the image region of the imaging condition B adjacent tothe image region (Step S2205). Specifically, the region setting unit1121 magnifies/reduces the search region SA as shown in FIG. 16, forexample.

As in S2104 and S2105, the motion detection unit 1110 allows the motiongeneration unit 1122 to scan the search window w in themagnified/reduced search region SA to thereby execute the block matchingof the target block b1 (Step S2206) to generate the motion vector myfrom the block b2 to the target block b1 (Step S2207).

This can consequently selectively achieve, depending on themagnification/reduction of the search region SA, the suppression of thedecline of the block matching accuracy or the reduction of theprocessing load of the block matching.

<Block Matching Example at Different Pixel Accuracies>

Next, the following section will describe an example of the blockmatching at different pixel accuracies. The above-described example wasdescribed in which, regardless of the type of the imaging condition, themotion detection unit 1110 executes the block matching on the searchregion SA of the imaging condition A in the search range SR (includingthe magnified/reduced one) and no block matching is executed on theremaining image regions of the search range SR. The following sectionwill describe an example in which the block matching is executed in thesearch region SA at different pixel accuracies.

FIG. 23 illustrates the example of the block matching at different pixelaccuracies. The same parts as those of FIG. 9 are denoted with the samereference numerals and will not be described further. In FIG. 23, thepixel accuracy is used and the motion detection unit 1110 may include,within the search range SR, the search region SA of the imagingcondition A (including the magnified/reduced one, hereinafter the firstsearch region SA10). The first search region SA10 is subjected to theblock matching at a certain pixel accuracy PA1 while the remaining imageregions of the search range SR (hereinafter the second search regionSA20) are subjected to the block matching at a pixel accuracy PA2 lowerthan a pixel accuracy PA1.

For example, the pixel accuracy PA1 at the first search region SA10 is a½ pixel accuracy while the pixel accuracy PA2 at the second searchregion SA20 is an integer pixel accuracy. The combination of the pixelaccuracies PA1 and PA2 is not limited to the above combination and maybe any combination so long as the pixel accuracy PA1 is higher than thepixel accuracy PA2. For example, the pixel accuracy PA1 at the firstsearch region SA10 may be a ¼ pixel accuracy and the pixel accuracy PA2at the second search region SA20 may be a ½ pixel accuracy.

The motion detection unit 1110 may determine the first search regionSA10 and the second search region SA20 based on the respective imagingconditions A and B (or a difference between the imaging conditions A andB), respectively. For example, the pixel accuracy may be a 1 pixelaccuracy, a ½ pixel accuracy, or a ¼ pixel accuracy. When the imagingcondition A has the exposure time of 1/30 [seconds] and the imagingcondition B has the exposure time of 1/60 [seconds], a differencebetween the exposure times is small, thus causing a possibility wherethe main subject may exist in the image region of the imaging conditionB.

Thus, when the difference between the imaging conditions A and B isequal to or lower than the threshold value T1, the region setting unit1121 sets the pixel accuracy PA1 of the first search region SA10 to the½ pixel accuracy and sets the pixel accuracy PA2 of the second searchregion SA20 to the 1 pixel accuracy. This can consequently suppress thedecline of the block matching accuracy.

When the imaging condition A has the exposure time of 1/30 [seconds] andthe imaging condition B has the exposure time of 1/1000 [seconds] forexample, there is a large difference in the exposure time, thus causinga high possibility where the main subject image does not exist in theimage region of the imaging condition B. Thus, when the differencebetween the imaging conditions A and B exceeds the threshold value T2(T2≥T1), the region setting unit 1121 sets the pixel accuracy PA1 of thefirst search region SA to the ¼ pixel accuracy and sets the pixelaccuracy PA2 of the second search accuracy to the 1 pixel accuracy. Theregion setting unit 1121 sets the pixel accuracy PA1 of the first searchregion SA10 to the ½ pixel accuracy and sets the pixel accuracy PA2 ofthe second search region SA20 to the 1 pixel accuracy. This canconsequently achieve the reduction of the processing load of the blockmatching.

In this manner, the pixel accuracy of the second search region SA20 setto be lower than the pixel accuracy of the first search region SA10 canachieve, while the block matching of the second search region SA20 isallowed to be executed with a lower processing load than in the case ofthe first search region SA10, the suppression of the decline of theblock matching accuracy when compared with a case where no blockmatching is executed on the second search region SA20.

<The Motion Vector Detection Processing Procedure at Different PixelAccuracies>

FIG. 24 is a flowchart illustrating an example of the motion vectordetection processing procedure by the motion detection unit 1110 atdifferent pixel accuracies. It is noted that the pixel accuracies of thefirst search region SA10 and the second search region SA20 may be set byallowing a user to operate the operation unit 505 or may beautomatically set by the electronic device 500 depending on the lightreception amounts of the respective unit groups 202 in the imagingelement 100. The same processing details as those of FIG. 21 and FIG. 22are denoted with the same step numbers and will not be describedfurther.

After Step S2204, the motion detection unit 1110 allows the regionsetting unit 1121 to determines, based on the imaging condition A andthe imaging condition B, the respective pixel accuracies PA1 and PA2 forthe block matching of the first search region SA10 and the second searchregion SA20 (Step S2405).

As in Steps S2104 and S2105, the motion detection unit 1110 allows themotion generation unit 1122 to scan the search window w in the firstsearch region SA10 and the second search region SA20 after thedetermination of the pixel accuracies to thereby subject the targetblock b1 on the block matching (Step S2406) to generate the motionvector my from the block b2 to the target block b1 (Step S2407).

This can consequently optimize, depending on the pixel accuracy of thesearch region SA, the suppression of the decline of the block matchingaccuracy and the reduction of the processing load of the block matching.Furthermore, even when the motion vector is detected at different pixelaccuracies, as shown in the motion detection processing procedureexample 2 of FIG. 22, the motion detection unit 1110 may allow theregion setting unit 1121 to magnify the first search region SA10 (inthis case, the second search region SA20 is reduced) or to reduce thefirst search region SA10 (in this case, the second search region SA20 ismagnified).

This can consequently optimize, depending on the pixel accuracy and themagnification/reduction of the search region SA, the suppression of thedecline of the block matching accuracy and the reduction of theprocessing load of the block matching in a more effective manner.

(1) As described above, the above-described video compression apparatuscompresses video data as a series of frames outputted from the imagingelement 100 that has a plurality of imaging regions for imaging asubject and for which imaging conditions can be set for the respectiveimaging regions. This video compression apparatus has the region settingunit 1121 and the motion generation unit 1122. The region setting unit1121 sets, based on a plurality of imaging conditions, the search regionSA in the reference frame used in a processing (e.g., the blockmatching) to detect a specific region (e.g., the block b2) from areference frame (e.g., the frame F2) based on compression target region(e.g., the target block b1). The motion generation unit 1122 detects aspecific region (e.g., the block b2) based on the processing using thesearch region SA set by the region setting unit 1121 (e.g., the blockmatching) to thereby generate the motion vector my.

This can consequently set the range of the search region SA to a rangeconsidering a plurality of imaging conditions.

(2) Furthermore, in the above (1), the region setting unit 1121 may setthe search region SA to a specific image region including thecompression target region imaged based on a specific imaging condition(e.g., the imaging condition A) among image regions imaged respectivelybased on a plurality of imaging conditions.

This allows consequently to limit the search region SA by the specificimaging condition, thus allowing the specific region detectionprocessing (e.g., the block matching) to have a reduced processing load.

(3) Furthermore, in the above (2), the region setting unit 1121 may setthe search region SA to the specific image region and image regions ofother imaging conditions surrounding the specific image region (e.g.,the imaging condition B).

In this manner, by setting the search region SA to include thesurroundings of the specific image region, the reduction of the motionvector detection accuracy can be suppressed, while allowing the motionvector detection to have a reduced processing load.

(4) Furthermore, in the above (2), the region setting unit 1121 maymagnify or reduce the search region SA based on a plurality of imagingconditions.

This can consequently selectively achieve, depending on themagnification/reduction of the search region SA, the suppression of thedecline of the accuracy of the specific region detection processing orthe reduction of the processing load.

(5) Furthermore, in the above (4), the region setting unit 1121 maymagnify or reduce the search region SA based on a difference in thevalues shown in a plurality of imaging conditions (e.g., a difference inthe ISO sensibility).

(6) Furthermore, in the above 4, the region setting unit 1121 reducesthe search region when the specific imaging condition (e.g., the imagingcondition A) is a specific exposure time and other imaging conditions(e.g., the imaging condition B) other than a specific imaging conditionamong a plurality of imaging conditions is an exposure time shorter thana specific exposure time.

This can consequently achieve, even when the exposure time of the mainsubject is so-called long time-second, the reduction of the processingload of the specific region detection processing.

(7) Furthermore, in the above (1), the region setting unit 1121 sets,for the first search region SA10, a specific image region for which aspecific imaging condition having the compression target region amongimage regions having a plurality of imaging conditions and sets, for thesecond search region SA20, other image regions other than the specificimage region among the image regions. The motion generation unit 1122may generate the motion vector my by using the first search region SA10set by the region setting unit 1121 and the second search region SA20set by the region setting unit 1121 to execute the specific regiondetection processing having different pixel accuracies.

This can consequently execute the specific region detection processingat the pixel accuracy depending on the imaging condition.

(8) Furthermore, in the above (7), the motion generation unit 1122 mayallow the specific region detection processing in the first searchregion SA10 to have the pixel accuracy higher than that of the specificregion detection processing in the second search region SA20.

In this manner, the second search region SA20 having the pixel accuracylower than the pixel accuracy of the first search region SA10 canprovide, in the block matching of the second search region SA20, thesuppression of the decline of the accuracy of the specific regiondetection processing when compared with a case where the second searchregion SA20 is not subjected to the specific region detection processingwhile achieving the reduction of the processing load more than in thecase of the first search region SA10.

(9) Furthermore, in the above (2), the motion generation unit 1122 mayexecute the specific region detection processing at the exterior of thesearch region SA based on the result of the specific region detectionprocessing in the search region SA. Specifically, when the block b2matching the target block b1 is not detected in the search region SA,the motion generation unit 1122 executes the specific region detectionprocessing on the remaining image regions that are within the searchrange SR and that exclude the search region SA (i.e., the image regionof the imaging condition B), for example.

This can provide the search in the search region SA in a prioritizedmanner, thus providing the reduction of the processing load of thespecific region detection processing and providing, even when the blockb2 is not detected in the search region SA, the suppression of thedecline of the accuracy of the specific region detection processing.

(10) Furthermore, in the above (2), the motion generation unit 1122 mayexecute the specific region detection processing for the search targetrange as a matching target with the compression target region in thesearch region SA (e.g., the search window w) based on the ratio betweenthe specific pixels included in the search target range and the specificimage region (e.g., the image region of the imaging condition A) andother pixels included in the image regions other than the search targetrange and the specific image region (e.g., the image region of theimaging condition B).

This can consequently adjust, at the boundary of the image regions ofthe different imaging conditions, the decline of the processing load andthe suppression of the decline of the accuracy for the specific regiondetection processing.

(11) Furthermore, in the above (10), the motion generation unit 1122 mayexecute the specific region detection processing so that the searchtarget range includes specific pixels only.

This can consequently pay a particular attention on the reduction of theprocessing load in the specific region detection processing at theboundary of the image regions of the different imaging conditions.

(12) Furthermore, in the above (10), the motion generation unit 1122 mayexecute the specific region detection processing so that the number ofspecific pixels within the search target range is higher than the numberof other pixels.

This can consequently provide, at the boundary of the image regions ofthe different imaging conditions, the suppression of the decline of theaccuracy in the specific region detection processing while prioritizingthe reduction of the processing load.

(13) Furthermore, in the above (10), the motion generation unit 1122 mayexecute the specific region detection processing so that the searchtarget range includes therein at least one specific pixel(s).

This can consequently provide, at the boundary of the image regions ofthe different imaging conditions, the suppression of the decline of theaccuracy in the specific region detection processing while prioritizingthe reduction of the processing load.

(14) Furthermore, in the above-described electronic device has theimaging element 100, the region setting unit 1121, and the motiongeneration unit 1122. The imaging element 100 has a plurality of imagingregions for imaging a subject and outputs video data for which imagingconditions can be set for the respective imaging regions and that are aseries of frames. The region setting unit 1121 sets, based on aplurality of imaging conditions, the search region SA in the referenceframe used in the processing (e.g., the block matching) to detect thespecific region (e.g., the block b2) in the reference frame (e.g., theframe F2) based on the compression target region (e.g., the target blockb1). The motion generation unit 1122 detects specific region (e.g., theblock b2) based on the processing using the search region SA set by theregion setting unit 1121 (e.g., the block matching) to thereby generatethe motion vector my.

This can consequently realize the electronic device 500 for which therange of the search region SA can be set to a range in consideration ofa plurality of imaging conditions. It is noted that the above-describedthe electronic device 500 may be a digital camera, a digital videocamera, a smart phone a tablet, a monitoring camera, a drive recorder,or a drone, for example.

(15) Furthermore, the above-described video compression program causesthe processor 1001 to execute the compression of video data as a seriesof frames outputted from the imaging element 100 that has a plurality ofimaging regions for imaging a subject and for which imaging conditionscan be set for the respective imaging regions. This video compressionprogram causes the processor 1001 to set, based on a plurality ofimaging conditions, the search region SA within the reference frame usedin the processing (e.g., the block matching) to detect based on thecompression target region (e.g., the target block b1), the specificregion (e.g., the block b2) in the reference frame (e.g., the frame F2).This video compression program causes the processor to generate themotion vector my by detecting the specific region (e.g., the block b2)based on the processing (e.g., the block matching) using the set searchregion SA.

This allows the range of the search region SA to be set in considerationof a plurality of imaging conditions to be realized by software. It isnoted that this video compression program may be recorded on a portablerecording medium such as CD-ROM, DVD-ROM, flash memory, or the memorycard 504. This video compression program may be recorded in a servercapable of providing the downloading operation to the video compressionapparatus or the electronic device 500.

What is claimed is:
 1. A video compression apparatus for compressingvideo data as a series of frames outputted from an imaging element thathas a plurality of imaging regions for imaging a subject and for whichimaging conditions can be set for the respective imaging regions,comprising: a setting unit configured to set, based on an imagingcondition set in a compression target region of a frame different from areference frame, a search region for detecting a specific region in thereference frame; and a detection unit configured to detect, based on thecompression target region, the specific region in the search region setby the setting unit.
 2. The video compression apparatus according toclaim 1, wherein the setting unit is configured to set the search regionto the specific image region and image regions of other imagingconditions surrounding the specific image region.
 3. The videocompression apparatus according to claim 1, wherein the setting unit isconfigured to magnify or reduce the search region based on the relationamong the plurality of imaging conditions.
 4. The video compressionapparatus according to claim 3, wherein the setting unit is configuredto magnify or reduce the search region based on a difference amongvalues shown by the plurality of imaging conditions.
 5. The videocompression apparatus according to claim 3, wherein the setting unit isconfigured to reduce the search region when the specific imagingcondition is a specific exposure time and other imaging conditions amongthe plurality of imaging conditions other than the specific imagingcondition is an exposure time shorter than the specific exposure time.6. The video compression apparatus according to claim 1, wherein thesetting unit is configured to set, as a first search region, a specificimage region among image regions of images generated and having aplurality of imaging conditions that has a specific imaging conditionand in which the compression target region exists and set, as a secondsearch region, image regions other than the specific image region amongthe image regions, wherein the generation unit is configured to use thefirst search region set by the setting unit and the second search regionset by the setting unit to execute the processing having different pixelaccuracies to thereby generate the motion vector.
 7. The videocompression apparatus according to claim 2, wherein the generation unitis configured to execute the processing exterior of the search regionbased on the result of the processing in the search region.
 8. The videocompression apparatus according to claim 2, further comprising: acontrol unit configured to execute a block matching for a search targetrange as a matching target with the compression target region in thesearch region based on the ratio between specific pixels included in thesearch target range and the specific image region and other pixelsincluded in the image regions other than the search target range and thespecific image region.
 9. A video compression apparatus for compressingvideo data as a series of frames outputted from an imaging element thathas a plurality of imaging regions for imaging a subject and for whichimaging conditions can be set for the respective imaging regions,comprising: a setting unit configured to set a search region fordetecting a specific region within a reference frame based on at leastone of the plurality of imaging conditions set to the imaging element;and a detection unit configured to detect, based on a compression targetregion having a frame different from the reference frame, the specificregion from the search region set by the setting unit.
 10. A videocompression program for causing a processor to execute the compressionof video data as a series of frames outputted from an imaging elementthat has a plurality of imaging regions for imaging a subject and forwhich imaging conditions can be set for the respective imaging regions,wherein the video compression program causes the processor: to set,based on an imaging condition set in a compression target region of aframe different from a reference frame, a search region for detecting aspecific region in the reference frame; and to detect, based on thecompression target region, the specific region in the search region. 11.A video compression program for causing a processor to execute thecompression of video data as a series of frames outputted from animaging element that has a plurality of imaging regions for imaging asubject and for which imaging conditions can be set for the respectiveimaging regions, to set a search region for detecting a specific regionwithin a reference frame based on at least one of the plurality ofimaging conditions set to the imaging element; and to detect, based on acompression target region having a frame different from the referenceframe, the specific region from the search region set by the settingunit.